function [alpha,diff_star_crit]= find_alpha(group_interest,diff_star,beta)

Nj=size(group_interest,2);
diff_star_crit=NaN*ones(1,Nj);
reps=size(diff_star,1);

for kk=1:Nj,
    diff_star_crit(1,kk)=percentiles(abs(diff_star(:,kk)),100*ones(1,1)-beta);
end;

    % COMPUTE NUMBER OF DRAWS FOR WHICH IS OUT OF INTERVAL

out=(abs(diff_star)>ones(reps,1)*diff_star_crit);

max_out=max(out,[],2);

    % COMPUTE alpha

alpha=100*sum(max_out,1)/reps;

    %
